package hik;

import java.io.File;

public class HCNetSDKPath {

	public static String DLL_PATH;
	  static {
	    String path = (HCNetSDKPath.class.getResource("/").getPath()).replaceAll("%20", " ").substring(1).replace("/",
	        "\\");
	    try {
	      DLL_PATH = java.net.URLDecoder.decode(path, "utf-8");
	      System.out.println("DLL_PATH:"+DLL_PATH);
	      File directory = new File("");// 参数为空
	      DLL_PATH = directory.getCanonicalPath()+File.separator;
		  System.out.println("path2: "+DLL_PATH);
	    } catch (Exception e) {
	      e.printStackTrace();
	    }
	  }
	  
	  
	  /**
		 * 系统类型：本地Windows- 0；服务器Linux- 1
		 */
		private static int type = -1;
		
		public static int getType() {
			if (type == -1) {
				String systemName=System.getProperty("os.name");
				if(systemName.contains("Windows")||systemName.contains("windows")){
					type=0;
				}else{
					type=1;
					System.out.println("当前系统名称为:"+systemName+" 设置systemType值为："+type);
				}
			}
			return type;
		}
}
